﻿function userModel(serverUserModel) {
    var self = this;

    self.id         = serverUserModel != null ? ko.observable(serverUserModel.id) : ko.observable('unknown');
    self.userName = serverUserModel != null ? ko.observable(serverUserModel.UserName) : ko.observable('unknown');
    self.password = serverUserModel != null ? ko.observable(serverUserModel.Password) : ko.observable('unknown');
    self.userType = serverUserModel != null ? ko.observable(serverUserModel.userType) : ko.observable(0);

    return (serverUserModel != null) ? self : 'unknown';

}